<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>Module Comportement</title>
	<link rel="stylesheet" type="text/css" href="css/design.css"/>
</h:head>

<h:body>
	<!-- inclusion de l'entete  -->
	<ui:include src="html/entete.xhtml"></ui:include>
	<!-- inclusion du menu -->
	<ui:include src="html/menu.xhtml"></ui:include>
	
	<ui:fragment rendered="#{serveur.setting}">
		<h3 class="h3_titre">Module Comportement</h3>
	</ui:fragment>
	<ui:fragment rendered="#{!serveur.setting}">
		
	</ui:fragment>
	
	<table style="border:solid; border-collapse: collapse;">
		<tr>
			<td class="standard" colspan="2" style="text-align: center; ">
				<h:form>
					<h:commandButton value="Desactiver" action="#{comportement.stopComportement}" style="width: 250px; height: 50px; "></h:commandButton>
				</h:form>
			</td>
		</tr>
		<tr>
			<th class="standard" style="padding-left: 20px; padding-right: 20px;">Nom</th>
			<th class="standard" style="padding-left: 20px; padding-right: 20px;">Action</th>
		</tr>
		<ui:repeat varStatus="status" var="data" value="#{comportement.cpt}">
			<tr>
				<h:panelGroup rendered="#{status.even}">
					<td class="standard impaire">#{data}</td>
					<h:form>
						<td class="standard impaire">
							<h:commandButton value="Activer le comportement" action="#{comportement.commande}">
								<f:setPropertyActionListener target="#{comportement.comp}" value="#{data}"></f:setPropertyActionListener>
							</h:commandButton>
						</td>
					</h:form>
				</h:panelGroup>
				<h:panelGroup rendered="#{status.odd}">
					<td class="standard paire">#{data}</td>
					<h:form>
						<td class="standard paire">
							<h:commandButton value="Activer le comportement" action="#{comportement.commande}">
								<f:setPropertyActionListener target="#{comportement.comp}" value="#{data}"></f:setPropertyActionListener>
							</h:commandButton>
						</td>
					</h:form>
				</h:panelGroup>
			</tr>
		</ui:repeat>
	</table>
	<br/>
	<!-- inclusion du pied de page -->
	<ui:include src="html/pied.xhtml"></ui:include>
</h:body>

</html>